import { useMemberStore } from '@/store'
import { chatHistoryResult, chatParams, MessageResult, textToAudioParams } from '@/types/knowChat'
import { http } from '@/utils/http'

/**
 * 根据chatId查询聊天记录
 * @param chatId 会话id
 * @returns 聊天记录
 */
export const getMessageAPI = (chatId: string) => {
  return http.get<MessageResult[]>('/member/chat/message/' + chatId)
}

/**
 * 根据用户和会话类型查询会话历史列表
 * @param chatType 会话类型
 * @returns 
 */
export const getChatHistoryAPI = (chatType: string) => {
  return http.get<chatHistoryResult[]>('/member/chat/history/' + chatType)
}

/**
 * 发送消息
 * @param params 发送消息参数
 * @returns 聊天结果
 */
export const getChatAPI = (params: chatParams) => {
    http.get('/member/chat', params)
}